class Person {
    name: string
    age: number

    constructor(name: string,age: number){ // 初始化
        this.name = name
        this.age = age
    }

    eating(){
        console.log(this.name + "eating");
    }
}

const p = new Person('why',18) // 会执行constructor方法





export {}